public class Soultion2 {
    public boolean searchMatrix(int[][] matrix, int target) {
        if(matrix.length==0)return false;
        for(int[] i:matrix){
            for (int j:
                 i) {
                if(j==target){
                    return true;
                }
            }
        }
        return false;
    }
}
